package springbootweb02.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springbootweb02.pojo.Emp;
import springbootweb02.utils.Result;
import springbootweb02.utils.XmlParserUtils;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

@RestController
public class XmlController {
    @GetMapping("listEmp")
    public Result rxml(){
        File file = new File("J:\\Java\\79\\Java79\\SpringBootWeb02\\src\\main\\resources\\emp.xml");
        String string = file.toString();
        List<Emp> parse = XmlParserUtils.parse(string, Emp.class);
        return Result.success(parse);
        
    }
}
